package com.three.controller;

import com.three.aop.LogAnotation;
import com.three.entity.BranchGoods;
import com.three.service.AddOutService;
import com.three.vo.OutGoodsListVo;
import com.three.vo.OutGoodsVo;
import com.three.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/addOut")
public class AddOutLibaryController {
    @Autowired
    private AddOutService addOutService;

    @PutMapping("/retail")
    @LogAnotation(value = "进行零售")
    //零售的方式
    public R retail(@RequestBody BranchGoods branchGoods){
        return addOutService.retail(branchGoods);
    }

    @PostMapping("/measured")
    @LogAnotation(value = "进行批量出库")
    //批量出库
    public R measured(@RequestBody ArrayList<OutGoodsListVo> list){
        return addOutService.measured(list);
    }
}
